import { defineConfig } from 'vitepress'
import { fileURLToPath, URL } from 'node:url'

export default defineConfig({
  title: "Vue3-Config-Form",
  description: "VUE + ElementPlus + TS 配置式表单",
  locales: {
    root: {
      label: '简体中文',
      lang: 'zh'
    }
  },
  themeConfig: {
    logo: "/favicon.ico",
    nav: [
      { text: '首页', link: '/' },
      { text: '内容', link: '/menu-why' }
    ],
    sidebar: [
      {
        text: '简介',
        items: [
          { text: '为什么要用“配置式表单”？', link: '/menu-why' },
          { text: '使用', link: '/menu-use' }
        ]
      },
      {
        text: '内容',
        items: [
          { text: 'ConfigForm 表单', link: '/menu-ConfigForm' },
          { text: 'ConfigTableForm 表格式表单', link: '/menu-ConfigTableForm' },
        ]
      },
      {
        text: '更多',
        items: [
          { text: '常见问题', link: '/menu-faq' },
          { text: '更多用法参考', link: '/menu-more' },
        ]
      }
    ],
    socialLinks: [
      { icon: 'github', link: 'https://gitee.com/he-kairui/vue3-config-form' },
    ],
    footer: {
      message: 'Apache-2.0 许可证发布',
      copyright: 'Copyright © 2023-present Carrey'
    },
    search: {
      provider: 'local'
    },
  },
  vite: {
    resolve: {
      alias: {
        '@': fileURLToPath(new URL('../../src', import.meta.url)), // 指向vue-config-form的src
        '@docs': fileURLToPath(new URL('./', import.meta.url)) // 指向docs目录
      }
    },

  }
})
